﻿using JX.Core.Entity;
using JX.Infrastructure;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace JX.Application
{
	/// <summary>
	/// 提现管理服务接口
	/// </summary>
	public interface IMentionServiceAppDapper
	{
		/// <summary>
		/// 申请提现。成功Data属性返回MentionLogID，失败返回错误原因。
		/// </summary>
		/// <param name="mentionLogEntity">提现数据</param>
		/// <param name="PayPassword">支付密码</param>
		/// <returns></returns>
		ResultInfo MentionApply(MentionLogEntity mentionLogEntity, string PayPassword);
		/// <summary>
		/// 申请提现。成功Data属性返回MentionLogID，失败返回错误原因。
		/// </summary>
		/// <param name="mentionLogEntity">提现数据</param>
		/// <param name="PayPassword">支付密码</param>
		/// <returns></returns>
		Task<ResultInfo> MentionApplyAsync(MentionLogEntity mentionLogEntity, string PayPassword);

		/// <summary>
		/// 人工提现。成功则扣除会员资金余额；失败则修改提现状态，并记录失败原因。
		/// </summary>
		/// <param name="MentionLogID">提现记录ID</param>
		/// <param name="MentionStatus">提现状态：1：提现成功；2：提现失败；3：处理中；</param>
		/// <returns></returns>
		ResultInfo MentionByArtificial(int MentionLogID, int MentionStatus = 1);
		/// <summary>
		/// 人工提现。成功则扣除会员资金余额；失败则修改提现状态，并记录失败原因。
		/// </summary>
		/// <param name="MentionLogID">提现记录ID</param>
		/// <param name="MentionStatus">提现状态：1：提现成功；2：提现失败；3：处理中；</param>
		/// <returns></returns>
		Task<ResultInfo> MentionByArtificialAsync(int MentionLogID, int MentionStatus = 1);

		/// <summary>
		/// 计算提现手续费用
		/// </summary>
		/// <param name="MentionAmount">提现金额</param>
		/// <returns></returns>
		decimal CalculatMentionHandlingCharge(decimal MentionAmount);
		/// <summary>
		/// 用于在提现之前，验证提现记录数据的完整性。失败返回错误原因，并把当前提现记录状态修改成“提现失败”。
		/// </summary>
		/// <param name="mentionLogEntity"></param>
		/// <returns></returns>
		ResultInfo MentionValidate(MentionLogEntity mentionLogEntity);
	}
}
